<?php
$this->breadcrumbs=array(
    'Quản trị'=>array('/admin'),
    'Lớp học'=>array('index'),
    'Quản lý',
);

$this->menu=array(
    array('label'=>'Danh sách', 'url'=>array('index')),
    array('label'=>'Thêm mới', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('guitar-class-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Quản lý lớp</h1>
<div class="search-form" style="display:none">
    <?php $this->renderPartial('_search',array(
    'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'guitar-class-grid',
    'dataProvider'=>$model->search(),
    //'filter'=>$model,
    'columns'=>array(
        //'id',
        array(
            'name'=>'facility_id',
            'value'=>'$data->facility->title'
        ),
        'title',
        'body:html',
        array(
            'name'=>'start_time',
            'value'=>'date("d/m/Y",$data->start_time);'
        ),
        array(
            'name'=>'end_time',
            'value'=>'date("d/m/Y",$data->end_time);'
        ),
        /*
          'create_time',
          'update_time',
          'status',
          */
        array(
            'class'=>'CButtonColumn',
        ),
    ),
)); ?>
